VERSION 5.00
Begin VB.Form frmLinGrad 
   BorderStyle     =   5  'Sizable ToolWindow
   Caption         =   "Linear Gradient"
   ClientHeight    =   7365
   ClientLeft      =   60
   ClientTop       =   330
   ClientWidth     =   6990
   Icon            =   "frmLinGrad.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   7365
   ScaleWidth      =   6990
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  'Windows Default
   Begin VB.TextBox txtCmd 
      Height          =   285
      Left            =   480
      TabIndex        =   19
      Top             =   6840
      Width           =   6135
   End
   Begin VB.OptionButton optHorz 
      Caption         =   "Horizontal"
      Height          =   255
      Left            =   1560
      TabIndex        =   17
      Top             =   6000
      Width           =   1095
   End
   Begin VB.OptionButton optVer 
      Caption         =   "Verticle"
      Height          =   255
      Left            =   360
      TabIndex        =   16
      Top             =   6000
      Value           =   -1  'True
      Width           =   855
   End
   Begin VB.HScrollBar C2 
      Height          =   255
      Index           =   2
      Left            =   4320
      Max             =   255
      TabIndex        =   11
      Top             =   5040
      Width           =   2295
   End
   Begin VB.HScrollBar C2 
      Height          =   255
      Index           =   1
      Left            =   4320
      Max             =   255
      TabIndex        =   10
      Top             =   4680
      Width           =   2295
   End
   Begin VB.HScrollBar C2 
      Height          =   255
      Index           =   0
      Left            =   4320
      Max             =   255
      TabIndex        =   9
      Top             =   4320
      Width           =   2295
   End
   Begin VB.HScrollBar C 
      Height          =   255
      Index           =   2
      Left            =   960
      Max             =   255
      TabIndex        =   7
      Top             =   5040
      Width           =   2295
   End
   Begin VB.HScrollBar C 
      Height          =   255
      Index           =   1
      Left            =   960
      Max             =   255
      TabIndex        =   6
      Top             =   4680
      Width           =   2295
   End
   Begin VB.HScrollBar C 
      Height          =   255
      Index           =   0
      Left            =   960
      Max             =   255
      TabIndex        =   2
      Top             =   4320
      Width           =   2295
   End
   Begin VB.PictureBox picGrad 
      AutoRedraw      =   -1  'True
      Height          =   3495
      Left            =   360
      ScaleHeight     =   3435
      ScaleWidth      =   6195
      TabIndex        =   0
      Top             =   600
      Width           =   6255
   End
   Begin VB.Label info2 
      BackStyle       =   0  'Transparent
      Caption         =   "Here is your command:"
      Height          =   255
      Left            =   360
      TabIndex        =   18
      Top             =   6600
      Width           =   1695
   End
   Begin VB.Label lblM2 
      BackColor       =   &H00000000&
      BorderStyle     =   1  'Fixed Single
      ForeColor       =   &H00FFFFFF&
      Height          =   255
      Left            =   3720
      TabIndex        =   15
      Top             =   5400
      Width           =   615
   End
   Begin VB.Label lblB2 
      BackColor       =   &H00000000&
      BorderStyle     =   1  'Fixed Single
      Caption         =   "0"
      ForeColor       =   &H00FFFFFF&
      Height          =   255
      Left            =   3720
      TabIndex        =   14
      Top             =   5040
      Width           =   615
   End
   Begin VB.Label lblG2 
      BackColor       =   &H00000000&
      BorderStyle     =   1  'Fixed Single
      Caption         =   "0"
      ForeColor       =   &H00FFFFFF&
      Height          =   255
      Left            =   3720
      TabIndex        =   13
      Top             =   4680
      Width           =   615
   End
   Begin VB.Label lblR2 
      BackColor       =   &H00000000&
      BorderStyle     =   1  'Fixed Single
      Caption         =   "0"
      ForeColor       =   &H00FFFFFF&
      Height          =   255
      Left            =   3720
      TabIndex        =   12
      Top             =   4320
      Width           =   615
   End
   Begin VB.Label lblM1 
      BackColor       =   &H00000000&
      BorderStyle     =   1  'Fixed Single
      ForeColor       =   &H00FFFFFF&
      Height          =   255
      Left            =   360
      TabIndex        =   8
      Top             =   5400
      Width           =   615
   End
   Begin VB.Label lblB1 
      BackColor       =   &H00000000&
      BorderStyle     =   1  'Fixed Single
      Caption         =   "0"
      ForeColor       =   &H00FFFFFF&
      Height          =   255
      Left            =   360
      TabIndex        =   5
      Top             =   5040
      Width           =   615
   End
   Begin VB.Label lblG1 
      BackColor       =   &H00000000&
      BorderStyle     =   1  'Fixed Single
      Caption         =   "0"
      ForeColor       =   &H00FFFFFF&
      Height          =   255
      Left            =   360
      TabIndex        =   4
      Top             =   4680
      Width           =   615
   End
   Begin VB.Label lblR1 
      BackColor       =   &H00000000&
      BorderStyle     =   1  'Fixed Single
      Caption         =   "0"
      ForeColor       =   &H00FFFFFF&
      Height          =   255
      Left            =   360
      TabIndex        =   3
      Top             =   4320
      Width           =   615
   End
   Begin VB.Label info 
      BackStyle       =   0  'Transparent
      Caption         =   "Imagine this box is your window. Here is a preview:"
      Height          =   255
      Left            =   360
      TabIndex        =   1
      Top             =   240
      Width           =   3615
   End
End
Attribute VB_Name = "frmLinGrad"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub C_Change(Index As Integer)
Call C_Scroll(Index)
End Sub

Private Sub C_Scroll(Index As Integer)
lblR1.Caption = C(0).Value
lblG1.Caption = C(1).Value
lblB1.Caption = C(2).Value
lblR1.BackColor = RGB(C(0).Value, 0, 0)
lblG1.BackColor = RGB(0, C(1).Value, 0)
lblB1.BackColor = RGB(0, 0, C(2).Value)
lblM1.BackColor = RGB(C(0).Value, C(1).Value, C(2).Value)
Call DrawIt
End Sub

Private Sub C2_Change(Index As Integer)
Call C2_Scroll(Index)
End Sub

Private Sub C2_Scroll(Index As Integer)
lblR2.Caption = C2(0).Value
lblG2.Caption = C2(1).Value
lblB2.Caption = C2(2).Value
lblR2.BackColor = RGB(C2(0).Value, 0, 0)
lblG2.BackColor = RGB(0, C2(1).Value, 0)
lblB2.BackColor = RGB(0, 0, C2(2).Value)
lblM2.BackColor = RGB(C2(0).Value, C2(1).Value, C2(2).Value)
Call DrawIt
End Sub

Private Sub DrawIt()
DrawGradient picGrad.hDC, picGrad.Width, picGrad.Height, lblM1.BackColor, lblM2.BackColor, Abs(CInt(optVer))
picGrad.Refresh
txtCmd.Text = "LinearGradient " & Abs(CInt(optVer)) & COMMA & C(0).Value & COMMA & C(1).Value & COMMA & C(2).Value & COMMA & C2(0).Value & COMMA & C2(1).Value & COMMA & C2(2).Value
End Sub

Private Sub optHorz_Click()
Call DrawIt
End Sub

Private Sub optVer_Click()
Call DrawIt
End Sub
